CHCP 65001
set gatewayName= "PandaCityInterfaceGateway"
set gatewayDesc= "熊猫CityInterface对外网关服务"
set authrName= "PandaCityInterfaceAuthorization"
set authDesc= "熊猫CityInterface对外用户认证服务"

echo "安装熊猫接口对外网关服务..."
cd %~dp0/nssm-nginx/win64
net stop %gatewayName%
sc delete %gatewayName%
nssm.exe install %gatewayName%  %~dp0/nginx-1.17.4/nginx.exe
if %errorlevel% == 0 (
    echo  " 注册【%gatewayName%】服务成功 "
    sc description %gatewayName%  %gatewayDesc%
) else (
    echo  " 注册【%gatewayName%】服务失败！！！ "
)

echo "安装认证服务..."
cd %~dp0/nssm-auth/win64
net stop %authrName%
sc delete %authrName%
nssm.exe install %authrName%  %~dp0/authorization/app.exe
if %errorlevel% == 0 (
    echo  " 注册【%authrName%】服务成功 "
    sc description %authrName%  %authDesc%
) else (
    echo  " 注册【%authrName%】服务失败！！！ "
)

echo  " 所有服务注册成功 "
pause
